'use strict';
exports.main = async (event, context) => {
	console.log(event)
	const db = uniCloud.database()
	return new Promise((resolve, rejects) => {
		if(event.strWarn=='重要'){
			db.collection('TodoList').doc(event._id).update({
				"strWarn": '一般'
			}).then((res) => {
				resolve(res)
			}).catch((err) => {
				rejects(err)
			})
		}else{
			db.collection('TodoList').doc(event._id).update({
				"strWarn": '重要'
			}).then((res) => {
				resolve(res)
			}).catch((err) => {
				rejects(err)
			})
		}
	})
};